/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ticketmaster.businesslogic;

import java.util.Collection;
import ticketmaster.dao.DAOFactory;
import ticketmaster.dao.ShippingMethodDAO;
import ticketmaster.dataobject.ShippingMethod;

/**
 *
 * @author Wei Liu
 */
public class ShippingMethodsController
{
    public Collection<ShippingMethod> getAllShippingMethods()
    {
        ShippingMethod method = new ShippingMethod();
        ShippingMethodDAO shippingMethodDAO = DAOFactory.getInstance().getShippingMethodDAO();
        return shippingMethodDAO.getShippingMethodDO(method);
    }

    public ShippingMethod getShippingMethod(int shippingMethodID)
    {
        ShippingMethod method = new ShippingMethod();
        method.setShippingMethodID(shippingMethodID);
        ShippingMethodDAO shippingMethodDAO = DAOFactory.getInstance().getShippingMethodDAO();
        return shippingMethodDAO.findShippingMethod(method);
    }

    public double getShippingMethodPrice(int shippingMethodID)
    {
        ShippingMethod method = this.getShippingMethod(shippingMethodID);
        return method.getPrice();
    }
}
